import {Col, DatePicker, Form, Input, InputNumber, Row, Select} from "antd";
import React from "react";
import BaseComponent from "../../redare/components/BaseComponent";


export default class GeneratorSysForm extends BaseComponent {

    formRef = React.createRef();

    constructor(props) {
        super(props);
        this._form.extraValue = {};
    }

    validateFormFields() {
        return new Promise((resolve, reject) => {
            this.formRef.current.validateFields().then((values) => {
                let resultValues = {...values, ...this._form.extraValue}
                resolve(resultValues);
            }).catch((errorInfo) => {
                reject(errorInfo);
            });
        });
    }

    setFormData(data) {
        if (this.formRef.current && data) {
            this.formRef.current.setFieldsValue(data);
        }
    }

    resetFormFields() {
        if (this.formRef.current) {
            this.formRef.current.resetFields();
        }
    }

    render() {
        return (
            <Form labelCol={{span: 6}} ref={this.formRef}>
                <Row gutter={[24, 24]}>
                    <Col sm={24} md={24} lg={24} xl={24}>
                        <Form.Item
                            name={"code"}
                            label="系统编码"
                            rules={[{required: true, message: '请输入系统编码'}]}
                        >
                            <Input placeholder="请输入系统编码" maxLength="45"/>
                        </Form.Item>
                    </Col>
                    <Col sm={24} md={24} lg={24} xl={24}>
                        <Form.Item
                            name={"name"}
                            label="系统名称"
                            rules={[{required: true, message: '请输入系统名称'}]}
                        >
                            <Input placeholder="请输入系统名称" maxLength="45"/>
                        </Form.Item>
                    </Col>
                </Row>
            </Form>
        )
    }


}







